﻿@using TMall.ManageSite.ViewModel
@model List<RoleVM>
<div class="pageContent">
    @using (@Html.BeginForm("BindRole", "Account", method: FormMethod.Post, htmlAttributes: new { @class = "pageForm required-validate", @onsubmit = "return validateCallback(this, dialogAjaxDone);" }))
    {
        @Html.Hidden("navId")
        @Html.Hidden("userId")
        <div class="pageFormContent" layouth="57">
            <p>
                @foreach (RoleVM role in Model)
                {
                    <label>
                        @if (role.IsSelected)
                        {
                            <input type="checkbox" checked="checked" name="roleSysnos" value="@role.SysNo" />
                        }
                        else
                        {
                            <input type="checkbox" name="roleSysnos" value="@role.SysNo" />
                        }
                        @role.RoleName</label>
                }
            </p>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                保存</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消</button></div>
                    </div>
                </li>
            </ul>
        </div>
    }
</div>
